home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Headers / misckit / MiscFileFinder.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-27  |  2.2 KB  |  72 lines

  1. /*============================ MiscFileFinder.h ==========================*/
  2. //        Written by Dale Amon, copyright 1994 by Genesis Project, Ltd.
  3. //                Version 0.8.  All rights reserved.
  4. //
  5. //        This notice may not be removed from this source code.
  6. //
  7. //    This object is included in the MiscKit by permission from the author
  8. //    and its use is governed by the MiscKit license, found in the file
  9. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  10. //    for a list of all applicable permissions and restrictions.
  11. //    
  12.  
  13. /* Class for finding files of a defined type, where ever they may be. Uses
  14.    not only NeXT Workspace manager search, but also searches user specified
  15.    environment variable that can be changed at run time and a programmer
  16.    specified compile time default path. This allows a series of overrides or
  17.    fallbacks:
  18.     1) Run time specification
  19.     2) Compile time defaults
  20.     3) Workspace manager's path
  21.    Files can be selected by name and restricted to matches with the correct
  22.    mode mask, ie readable, executable...
  23.  
  24. HISTORY
  25. 18-Sep-93  Dale Amon at GPL
  26.        Created. Split some portions off RemoteApplication class to create
  27.        a general means of finding files with a particular type, regardless
  28.        of location.
  29. */
  30.  
  31. #define    MISC_FILEFINDER_VERSION_ID    0.8
  32.  
  33. @interface MiscFileFinder : Object
  34. {   const char    *typeName;        /* Name of the type object */
  35.     const char    *defaultPath;    /* Default path for this type */
  36.     const char    *pathVariable;    /* Environment PATH variable name */
  37.     int        fileMode;            /* Required attributes of file type:
  38.                                     R_OK, X_OK, etc */
  39.  
  40.     char    *pathTmp;            /* Temp to hold result of current search */
  41. }
  42.  
  43. + initialize;
  44. + (BOOL) debug;
  45. + setDebug: (BOOL) flg;
  46. + findFileTypeNamed: (const char*) aKey;
  47.  
  48. - free;
  49. - init;
  50. - initName:       (const char  *) name
  51.       defaultPath: (const char    *) path
  52.      pathVariable: (const char    *) var
  53.          mode: (int)       fmode;
  54.  
  55. - (char *) fullPathForFile: (const char *) filename;
  56.  
  57. - (BOOL) setTypeName: (const char*) name;
  58. - setDefaultPath:  (const char*) path;
  59. - setPathVariable: (const char*) var;
  60. - setFileMode:       (int)     mode;
  61.  
  62. - (const char*) typeName;
  63. - (const char*) pathVariable;
  64. - (const char*) defaultPath;
  65. - (int)        fileMode;
  66.  
  67. - write:(NXTypedStream *) stream;
  68. - read: (NXTypedStream *) stream;
  69.  
  70. @end
  71.  
  72.